package com.example.datascreen.mapper;

import com.example.datascreen.entity.Essay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EssayMapper {
    @Select({"SELECT COUNT(*) FROM essay"})
    int getAllNum();

    @Select({"SELECT COUNT(*) FROM essay WHERE author LIKE '%机器人%'"})
    int getRobotNum();

    @Select("SELECT * FROM essay")
    List<Essay> getEssayPieList();

    @Select("select * from essay where `column` = '成都财经'")
    List<Essay> getCdcjLineList();
    @Select("select * from essay where `column` = '全球财经'")
    List<Essay> getQqcjLineList();
    @Select(" select * from essay where `column` = '宏观经济'")
    List<Essay> getHgjjLineList();
    @Select(" select * from essay where `column` = '外汇市场'")
    List<Essay> getWhscLineList();
    @Select(" select * from essay where `column` = '四川财经'")
    List<Essay> getSccjLineList();
    @Select("select * from essay where `column` = '货币市场'")
    List<Essay> getHbscLineList();
    @Select("SELECT author FROM essay GROUP BY author ORDER BY COUNT(author)")
    List<String> getAuthor();
    @Select("SELECT COUNT(*) FROM essay WHERE author = #{author}")
    int getNumByAuthor(String author);

    @Select("select * from essay")
    List<Essay> getBooklist();

    @Select("select * from essay")
    List<Essay> getEssayList();
}
